#include "widget.h"
#include "ui_widget.h"

#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    void (Widget::*Signal_p)(QString) = &Widget::MySignal;
    void (Widget::*Slot_p)(QString) = &Widget::MySlot;

    connect(this, Signal_p, this, Slot_p);

    EmitSignal(); // 发送信号
}

Widget::~Widget()
{
    delete ui;
}

void Widget::MySlot()
{
    qDebug() << "MySlot()被调用";
}

void Widget::MySlot(QString)
{
    qDebug() << "MySlot(QString)被调用";
    qDebug() << "yhwyhwyhw";
}

void Widget::EmitSignal()
{
    emit MySignal("yhwyhwyhw");
}
